Merged
Conversation
Required for aligning media upload flow (MD5 hash) and CDN URL construction (encrypted_query_param encoding) with Python SDK. Closes #14
- State dir resolution: check $OPENCLAW_STATE_DIR → $CLAWDBOT_STATE_DIR → ~/.openclaw
- Add normalize_account_id() and derive_raw_account_id() public functions
- Change sync buf format from plain text to JSON in accounts/{id}.sync.json
- Change get_account_config to read from global {state_dir}/openclaw.json
- Add chmod 600 on Unix for save_account_data
- Add tests for normalization, sync buf format, and global config parsing
Closes #14
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add constants: DEFAULT_LONG_POLL_TIMEOUT, DEFAULT_API_TIMEOUT, DEFAULT_CONFIG_TIMEOUT, DEFAULT_ILINK_BOT_TYPE, SDK_VERSION - Fix headers(): base64-encoded random u32 for X-WECHAT-UIN, content-type header, skip auth when token empty - Add base_info with SDK version to all POST payloads - Extract check_response() to check both errcode and ret fields - Add GET helper (get_with_timeout) for QR code endpoints - Change fetch_qr_code to GET with bot_type query param - Change get_qr_code_status to GET with iLink-App-ClientVersion header - Fix get_updates timeout to 35s (long poll) - Merge send_text_message + send_media_message into send_message - Fix send_typing to include typing_status, use 10s timeout - Fix get_upload_url to accept full media metadata - Add get_config endpoint - Update callers in runtime.rs, bot.rs, media.rs for new signatures Closes #14 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add constants UPLOAD_MEDIA_IMAGE/VIDEO/FILE/VOICE and MAX_UPLOAD_RETRIES - Rewrite parse_aes_key to support base64-encoded keys (raw 16-byte or hex) - Add aes_ecb_padded_size helper - Change download_media to use encrypted_query_param URL pattern with subdir - Add download_media_from_item for per-type field extraction (image/voice/file/video) - Rewrite upload_media with full Python SDK flow: random filekey, CDN POST, x-encrypted-param header extraction, retry logic, UploadResult struct - Update runtime.rs call sites minimally to compile (Task 5 will fix properly) - Add tests for base64 key parsing and padded size calculation Closes #14 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Switch to 1-based message type constants - Rewrite body_from_item_list for ref_msg - Add find_media_item with priority order - Add build_media_send_item per-type format - Replace to_user_id with from_user_id - Split text and media into separate sends - Forward error text to user on failure - Add typing cancel after response - Sleep 1 hour on session expiry - Extract send_outgoing_media helper - Update all tests for new type values Closes #14 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add QR code retry loop: outer loop refreshes QR (up to 3 times), inner loop polls status, with 480s global deadline - Handle response fields at root or nested under "data" - Accept both "scanned" and "scaned" status variants - Use storage::normalize_account_id() for account ID normalization Closes #14
c6d8e7b to
ce54599
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan
-D warnings)echo_bot,openai_bot)Closes #14
🤖 Generated with Claude Code